from playwri.sync_api import sync_playwright
import time

def test_case1():
    print('start case 01')
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=False)
        page = browser.new_page()
        page.goto('https://www.sogou.com/')
        print(page.title())
        assert page.title() == '搜狗搜索引擎 - 上网从搜狗开始'
        page.fill("input[name=\"query\"]", "web端自动化测试")
        time.sleep(2)
        page.click('input[id=\'stb\']')
        time.sleep(2)
        assert page.title()== 'web端自动化测试 - 搜狗搜索'

    print('case 01 end')